package com.kaidi.dibankecloud.widget;

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.PopupWindow;

import com.kaidi.dibankecloud.R;

/**
 * Created by Administrator on 2017/1/11.
 */

public class ActivatedErrorPopupWindow extends PopupWindow{
    public ActivatedErrorPopupWindow(Context context) {
        super(context);
        View rootView = LayoutInflater.from(context).inflate(R.layout.popup_activated_error, null);
        setContentView(rootView);
        setWidth((int) context.getResources().getDimension(R.dimen.reg_activated_error_width));
        setHeight((int) context.getResources().getDimension(R.dimen.reg_activated_error_height));
        ColorDrawable dw = new ColorDrawable(0000000000);
        setBackgroundDrawable(dw);
        setOutsideTouchable(true);
        setFocusable(true);
        update();
    }
    public void showPopupWindow(View anchor){
        if(!isShowing()){
            showAtLocation(anchor, Gravity.CENTER,0,0);
        }
    }
}
